package com.raylu.realtime.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * Description:
 * <p>
 * Create by lucienoz on 2021/12/30.
 * Copyright © 2021 lucienoz. All rights reserved.
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OrderWide {
    //OrderInfo
    String       order_id; //编号
    BigDecimal   order_total_amount;//总金额
    String       order_status;//订单状态
    String       user_id;//用户id
    String       order_create_time;//创建时间
    String       order_operate_time;//操作时间
    String       order_expire_time;//失效时间
    String       order_process_status;//进度状态
    String       parent_order_id;//父订单编号
    String       province_id;//地区
    BigDecimal   order_activity_reduce_amount;//促销金额
    BigDecimal   order_coupon_reduce_amount;//优惠券
    BigDecimal   order_original_total_amount;//原价金额
    BigDecimal   order_feight_fee;//运费
    BigDecimal   order_feight_fee_reduce;//运费减免
    String create_date;
    String create_hr;
    Long  ts;



    //OrderDetail
    String detail_id;//编号
    String sku_id;//sku_id
    String sku_name;//sku名称（冗余)
    BigDecimal pay_price;//购买价格(下单时sku价格）
    String sku_num;//购买个数
    String detail_create_time;//创建时间
    String detail_source_type;//来源类型
    String detail_source_id;//来源编号
    BigDecimal split_total_amount;
    BigDecimal split_activity_amount;
    BigDecimal split_coupon_amount;

    //user info
    String login_name;
    String name;
    String birthday;
    String gender;
    int age;


    //province info
    String province_name;
    String region_id  ;
    String area_code  ;
    String iso_code   ;
    String iso_3166_2 ;

    //region info
    String region_name;

    //sku info
    String spu_id          ;
    String sku_price       ;
    String tm_id           ;
    String category3_id    ;
    String sku_create_time ;

    //spu info
    String spu_name     ;

    //trademark
    String tm_name;

    //category3
    String category3_name;
    String category2_id;
    //category2
    String category2_name;
    String category1_id;
    //category1
    String category1_name;


    public OrderWide(OrderInfo orderInfo,OrderDetail orderDetail) {
        //orderInfo Init
        this.order_id=orderInfo.getId();
        this.order_total_amount=orderInfo.getTotal_amount();
        this.order_status=orderInfo.getOrder_status();
        this.user_id=orderInfo.getUser_id();
        this.order_create_time=orderInfo.getCreate_time();
        this.order_operate_time=orderInfo.getOperate_time();
        this.order_expire_time=orderInfo.getExpire_time();
        this.order_process_status=orderInfo.getProcess_status();
        this.parent_order_id=orderInfo.getParent_order_id();
        this.province_id=orderInfo.getProvince_id();
        this.order_activity_reduce_amount=orderInfo.getActivity_reduce_amount();
        this.order_coupon_reduce_amount=orderInfo.getCoupon_reduce_amount();
        this.order_original_total_amount=orderInfo.getOriginal_total_amount();
        this.order_feight_fee=orderInfo.getFeight_fee();
        this.order_feight_fee_reduce=orderInfo.getFeight_fee_reduce();

        //OrderDetail Init
        this.detail_id=orderDetail.getId();
        this.sku_id=orderDetail.getSku_id();
        this.sku_name=orderDetail.getSku_name();
        this.pay_price=orderDetail.getOrder_price();
        this.sku_num=orderDetail.getSku_num();
        this.detail_create_time=orderDetail.getCreate_time();
        this.detail_source_type=orderDetail.getSource_type();
        this.detail_source_id=orderDetail.getSource_id();
        this.split_total_amount=orderDetail.getSplit_total_amount();
        this.split_activity_amount=orderDetail.getSplit_activity_amount();
        this.split_coupon_amount=orderDetail.getSplit_coupon_amount();
        this.create_date=orderDetail.getCreate_time().substring(0,10);
        this.create_hr=orderDetail.getCreate_time().substring(11,13);
        this.ts = orderDetail.ts;
    }

}
